package vista;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.WindowConstants;

import controlador.Banco;

public abstract class Listado extends javax.swing.JFrame {
	private Banco banco;
	private JTable tabla;
	private JScrollPane scrollPane;
	private JPanel panel;

	public Listado(Banco banco) {
		super();
		this.banco = banco;
		initListado();
	}

	private void initListado() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

			JButton botonSalir = new JButton();
			botonSalir.setText("Salir");
			botonSalir.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent evt) {
					dispose();
				}
			});

			panel = new JPanel();
			add(panel);

			pack();
			setSize(600, 500);
			setResizable(false);
			setLocationRelativeTo(null);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public Banco getBanco() {
		return banco;
	}

	public JPanel getPanel() {
		return panel;
	}

	public void setTabla(JTable tabla) {
		this.tabla = tabla;
	}

	public void setScrollPane(JScrollPane scrollPane) {
		this.scrollPane = scrollPane;
	}
}